using UnityEngine;

public class BackgroundMovement : MonoBehaviour
{
    public float despawnX;
    private void Update()
    {
        transform.Translate(-LevelManager.I.levelSpeed * Time.deltaTime, 0, 0);
        if (transform.position.x < despawnX)
        {
            Destroy(gameObject);
        }
    }
}